package Reflect;

import java.util.Scanner;

public class ReflectDemo2 {
    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
//        Person person = new Person();
//        System.out.println(person);

        System.out.println("请输入一个类名");
        Scanner sc = new Scanner(System.in);
        while (true) {
            String className = sc.next();
            Class cls = Class.forName(className);
            Object obj = cls.newInstance();
            System.out.println(obj);
        }
    }
}
